package com.smarthome.core.workingmonitor.impl;

import java.util.Date;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.smarthome.base.service.ShSysHeartbeatService;
import com.smarthome.core.workingmonitor.SystemLogService;
import com.smarthome.domain.bean.ShSysHeartbeat;
import com.smarthome.domain.vo.boss.DataGrid;
import com.smarthome.domain.vo.boss.PageHelper;

/**
 * 
 * @ClassName: SystemLogServiceImpl
 * @Description: TODO(系统运行状态服务接口实现类)
 * @author cyj
 * @date 2015年9月28日 下午11:44:14
 *
 */
@Service("systemLogService")
public class SystemLogServiceImpl implements SystemLogService {

    @Resource
    private ShSysHeartbeatService sysHeartbeatService;

    @Override
    public DataGrid qeuryDataGrid(ShSysHeartbeat sysHeartbeat, PageHelper page) {
        return sysHeartbeatService.queryShSysHeartbeat(sysHeartbeat, page);
    }

    @Override
    public void record() {
        ShSysHeartbeat sysHeartbeat = new ShSysHeartbeat();
        sysHeartbeat.setStatus(1);
        sysHeartbeat.setGmtCreate(new Date());
        sysHeartbeatService.saveOrUpdate(sysHeartbeat);

    }

}
